/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 30318
 * Date: 2023-05-17
 * Time: 9:57
 */
//通过类 去描述 一个具体的对象
class Person{
    //属性
    public int age;//没有初始化时 默认值为0

    public String name;//没有初始化时 默认值为null

    //行为
    public void eat(){
        System.out.println("吃饭!");
    }

}
//class 类名->大驼峰
class WashMachine{
    //field 属性【字段】 -> 成员属性
    public String brand;    //品牌
    public String type;     //型号
    public double weight;   //重量
    public String color;    //颜色

    //method 行为【方法】 -> 成员方法
    // 方法名/变量是小驼峰
    public void washClothes(){  //  洗衣服
        System.out.println("洗衣功能");
    }

    public void dryClothes(){   //脱水
        System.out.println("脱水功能");
    }

    public void setTime(){      //定时
        System.out.println("定时功能");
    }
}

class Dog{
    //成员变量
    public String name;
    public String color;

    public void barks(){
        System.out.println(name + "汪！");
    }
    public void wag(){
        System.out.println(name + "摇尾巴！");
    }
}

public class Test {

    public static void main(String[] args) {
        //实例化一个Dog对象
        Dog dog = new Dog();
        dog.name = "CC";
        dog.color = "黄色";
        System.out.println(dog.name);
        System.out.println(dog.color);

        dog.barks();
        dog.wag();

        Dog dog2 = new Dog();
        dog2.name = "EE";
        dog2.color = "白色";
        System.out.println(dog2.name);
        System.out.println(dog2.color);

        dog2.barks();
        dog2.wag();

    }
}
